package cn.jtfadmin.base.filesystem;

import cn.jtfadmin.base.filesystem.config.FileResourceConfig;
import cn.jtfadmin.base.filesystem.config.FileSystem;
import cn.jtfadmin.base.filesystem.config.local.FileDirConfigDTO;
import cn.jtfadmin.base.filesystem.config.local.LocalFileSystemImpl;
import cn.jtfadmin.base.filesystem.controller.FilePrewController;
import cn.jtfadmin.base.filesystem.controller.FileUploadController;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;


/**
 * 文件系统配置
 */
@Configuration
@ConditionalOnMissingBean(value = FileSystem.class)
@ComponentScan(value = "cn.jtfadmin.base.filesystem")
public class LocalFileSystemConfig {

    @Bean
    FileSystem fileSystem(FileDirConfigDTO fileDirConfigDTO, ObjectProvider<FileResourceConfig> fileResourceConfigListOptional) {
        return new LocalFileSystemImpl(fileDirConfigDTO, fileResourceConfigListOptional);
    }
}
